from prompt_dict_val import *
import ast
config_dict_name_select="Qwen3-30B-A3B-Instruct-2507"
prompt_dict_key_select="1"
select_prompt=prompt_dict_buddle[prompt_dict_key_select]

# 文本分段配置
max_chars = 500  # 文本分段最大字符数

def load_dict_from_env(filepath=".env"):
    with open(filepath, "r") as f:
        content = f.read().strip()
    
    # 提取 config_dict= {...} 部分
    start = content.find("config_dict={") + len("config_dict=")
    end = content.rfind("}") + 1
    dict_str = content[start:end]
    
    # 安全解析成 Python 字典
    return ast.literal_eval(dict_str)

config_dict = load_dict_from_env()


openai_dict=dict(
            model=config_dict[config_dict_name_select]["model_name"],
            temperature=0.8,
            max_tokens=config_dict[config_dict_name_select]["max_tokens"],
            frequency_penalty=0.2,
            presence_penalty=0.2,
            top_p=0.8
        )



